package com.gof.example.iterator;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/10 23:05.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) {
        AbstractList list = new PageList();
        list.add("诸葛亮");
        list.add("司马懿");
        list.add("刘备");
        list.add("曹操");
        list.add("孙权");

        Iteratable iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
